#!/bin/bash

dbnmame=$1
dblogin=$2
dbpassword=$3

print_usage()
{
   echo "Usage: $0 <dbname> <dblogin> <dbpassword>"
   echo "Insert SEED into db."
}

if [ "x$dbpassword" == "x" ]; then
   echo "[ERROR] All arguments not available."
   print_usage
   exit 1
fi

/data/scripts/import_seed.pl -log import_seed.log $dbnmame $dblogin $dbpassword

error=`grep "\[ERROR\]" /tmp/import_seed.log`
res=$?
if [ $res -eq 0 ]; then
/data/scripts/sendmail.pl -f multisimgen.support@tcl.com -t raffi.semerciyan@jrdcom.com -s "Multisimgen >import_seed_sh< notification" /tmp/import_seed.log
fi
